﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public class Household : BaseModel,IValidate
    {
        public string Address { get; set; }
        public string Type { get; set; }

        public ValidateResult Validate()
        {
            ValidateResult result = new ValidateResult();
            if (string.IsNullOrEmpty(Address))
            {
                result.Valid = false; result.Messages.Add("地址不能为空！");
            }
            if (Address.Length > 500)
            {
                result.Valid = false; result.Messages.Add("地址不能超过500个字符！");
            }

            if (Type != null && Type.Length > 50)
            {
                result.Valid = false; result.Messages.Add("类型不能超过50个字符！");
            }
            return result;
        }
    }
}
